package com.zmx.user.entity;

import com.zmx.common.common.entitys.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.hibernate.annotations.Where;

/**
 * @author zhaomxr
 * null
 */
@Data
@Entity
@Table(name = "member_cart")
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper=true)
@Inheritance(strategy = InheritanceType.JOINED)
@Where(clause = "is_vaild = 1 and dr = 0")
public class MemberCart extends BaseEntity {

	/**
	 * 用户id
	 */
	@Column(name = "member_id")
	private Long memberId;

	/**
	 * 商品id
	 */
	@Column(name = "product_id")
	private Long productId;

	/**
	 * 商品数量
	 */
	@Column(name = "quantity")
	private Integer quantity;

	/**
	 * 是否有效
	 */
	@Column(name = "is_vaild")
	private Integer isVaild;

	/**
	 * null
	 */
	@Column(name = "remark")
	private String remark;
}
